<script src="<?= base_url(); ?>third_party/ckeditor/ckeditor.js"></script>
<style type="text/css">
.nicEdit-main {
	background-color: white !important;
	padding: 5px;
}
</style>

<div class="heading-buttons">
	<h3 class="glyphicons no-js show_thumbnails">
		<i></i> CMS Management
	</h3>
</div>
<div class="separator"></div>
<div class="widget widget-2 widget-body-white finances_summary">
	<div class="widget-head">
		<h4 class="heading glyphicons show_thumbnails">
			<i></i>CMS Configuration
		</h4>
	</div>
	<div class="widget-body">
		<div class="row-fluid">
			<form name="cat" method="POST"
				action="<?= base_url(); ?>secure/cms/cms_management/get_cms">

			
				<?php if($this->session->flashdata('message'))
				{
					$msg=$this->session->flashdata('message');
					echo '<font color="red">'.$msg.'</font>';
				}
				?>

				<table width="100%" cellpadding="4" cellspacing="4">

					<tr>

						<td width="20%">Template Type</td>
						<td width="60%"><select name="cms" onchange="this.form.submit()">
								<option value="">Select Setting --></option>
								<?php foreach($cms as $cms):?>
								<option value="<?= $cms->title;?>">
									<?= $cms->title;?>
								</option>
								<?php endforeach;?>
						</select>
						</td>

					</tr>
				</table>


			</form>
		</div>
	</div>
</div>
<?php if (isset($cms_id)) { ?>
<div class="widget widget-2 widget-body-white">
	<div class="widget-head">
		<h4 class="heading glyphicons show_thumbnails">
			<i></i> Update Cms :
			<?= $cms->title; ?>
		</h4>
	</div>
	<div class="widget-body">
		<div class="row-fluid">
			<form name="keyword" method="POST"
				action="<?= base_url(); ?>secure/cms/cms_management/update_cms">



				<table class="table table-condensed">



					<?php
					$this->session->flashdata('message'); {
						$msg = $this->session->flashdata('message');
						echo '<font color="red">' . $msg . '</font>';
					}
					?>

					<tbody>

						<tr>
							<td class="left">Position</td>
							<td><select name="position">
									
									<option value="0"
									<?php if ($cms->position=="0") echo 'selected="selected"';?>>Both</option>

									<option value="1"
									<?php if ($cms->position=="1") echo 'selected="selected"';?>>Top</option>
									<option value="2"
									<?php if ($cms->position=="2") echo 'selected="selected"';?>>Bottom</option>

							</select>
						
						</tr>

						<tr>
							<td class="left">Title</td>
							<td><input type="text" name="title" value="<?= $cms->title;?>" class="sapn8">
							</td>
						</tr>
						<tr>
							<td class="left">Url</td>
							<td><input name="url" value="<?= $cms->url;?>" type="text"
								class="sapn8"></td>
						</tr>
						<tr>
							<td class="left">Meta Title</td>
							<td><textarea name="meta_title"
									style="width: 620px; height: 30px"> <?= $cms->meta_title; ?> </textarea>
							</td>
						</tr>
						<tr>
							<td class="left">Meta Keyword</td>
							<td><textarea name="meta_keyword"
									style="width: 620px; height: 40px"> <?= $cms->meta_keyword; ?>
						</textarea></td>
						</tr>

						<tr>
							<td class="left">Meta Description</td>
							<td><textarea name="meta_description"
									style="width: 620px; height: 50px"> <?= $cms->meta_description; ?>
						</textarea></td>
						</tr>

						<tr>
							<td class="left">Template Type</td>
							<td><textarea id="cmscontent" name="cmscontent"
									style="width: 640px; height: 200px">
							<?= $cms->description;?>
                                        
                                        </textarea> <script
									type="text/javascript">
                                //<![CDATA[
                                CKEDITOR.replace( 'cmscontent',
                                {
                                    skin : 'v2',
                                    enterMode : CKEDITOR.ENTER_DIV,
                                    toolbar :
                                        [
                                        [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
                                        [ 'UIColor' ]
                                    ]
                                });
                                //]]>
                            </script>
							</td>
						</tr>
						<tr>
						<td class="center"></td>
						<td>
						<input name="cms_id" type="hidden" size="0"
								value="<?= $cms_id; ?>" />
					<input type="submit" class="pull-right btn btn-info" name="cms_update"
							<?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');" value="Update"
								onclick="nicEditors.findEditor('cmscontent').saveContent();return confirm('Are you sure you want to update?');" />
						</tr>
						
					</tbody>
				</table>
			</form>
		</div>
	</div>
</div>
<?php }?>





